//
//  CommissionBankCell.m
//  EasyToTesco2.0
//
//  Created by 杨森 on 2017/3/21.
//  Copyright © 2017年 EasyToTesco. All rights reserved.
//

#import "CommissionBankCell.h"

@implementation CommissionBankCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupView];
    }
    return self;
}

- (void)setupView
{
    
    self.bgView = [[UIView alloc] initWithFrame:CGRectMake(10, 0,WIDTH-20,80)];
    [self addSubview:_bgView];
    _bgView.backgroundColor = [UIColor grayColor];
    _bgView.layer.masksToBounds = true;
    _bgView.layer.cornerRadius = 5;
    

    self.bankLogoImg = [[UIImageView alloc] init];
    [_bgView addSubview:_bankLogoImg];
    _bankLogoImg.image = [UIImage imageNamed:@"icon_alipay_white"];
    
    self.bankNameLabel = [[UILabel alloc] init];
    _bankNameLabel.textColor = [UIColor whiteColor];
    [_bgView addSubview:_bankNameLabel];
    _bankNameLabel.font = FONT(15);
//
    
    self.bankUserLabel = [[UILabel alloc] init];
    _bankUserLabel.textColor = [UIColor whiteColor];
    [_bgView addSubview:_bankUserLabel];
    _bankUserLabel.font = FONT(13);
    
    self.hidLabel = [[UILabel alloc] init];
    _hidLabel.textColor = [UIColor whiteColor];
    [_bgView addSubview:_hidLabel];
    _hidLabel.font = FONT(20);
    _hidLabel.text = @"* * * * 　* * * * 　* * * *  ";
    
    self.bankNumberLabel = [[UILabel alloc] init];
    _bankNumberLabel.textColor = [UIColor whiteColor];
    [_bgView addSubview:_bankNumberLabel];
    _bankNumberLabel.font = FONT(20);
    
    [_bankLogoImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_bgView.mas_top).offset(10);
        make.left.equalTo(_bgView.mas_left).offset(15);
        make.width.height.mas_equalTo(30);
    }];
    
    [_bankNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(_bankLogoImg.mas_centerY);
        make.left.equalTo(_bankLogoImg.mas_right).offset(10);
    }];

    [_bankUserLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(_bankNameLabel.mas_bottom);
        make.right.equalTo(_bgView.mas_right).offset(-15);
    }];
    
    [_hidLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_bgView.mas_left).offset(15);
        make.top.equalTo(_bankLogoImg.mas_bottom).offset(10);
        make.height.mas_equalTo(15);
    }];

    [_bankNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(_hidLabel.mas_centerY);
        make.left.equalTo(_hidLabel.mas_right).offset(10);
    }];
}

@end
